/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.company.management.entity;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Paner
 */
@Entity
@Table(name = "employeescheduleinfo", catalog = "cafedb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "EmployeeScheduleInfo.findAll", query = "SELECT e FROM EmployeeScheduleInfo e"),
    @NamedQuery(name = "EmployeeScheduleInfo.findById", query = "SELECT e FROM EmployeeScheduleInfo e WHERE e.id = :id"),
    @NamedQuery(name = "EmployeeScheduleInfo.findByDate", query = "SELECT e FROM EmployeeScheduleInfo e WHERE e.date = :date"),
    @NamedQuery(name = "EmployeeScheduleInfo.findByFromTo", query = "SELECT e FROM EmployeeScheduleInfo e WHERE e.fromTo = :fromTo")})
public class EmployeeScheduleInfo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID", nullable = false)
    private Integer id;
    @Basic(optional = false)
    @Column(name = "DATE", nullable = false, length = 255)
    private String date;
    @Basic(optional = false)
    @Column(name = "FROM_TO", nullable = false, length = 255)
    private String fromTo;
    @JoinColumn(name = "EMPLOYEESCHEDULEID", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private EmployeeSchedule employeescheduleid;

    public EmployeeScheduleInfo() {
    }

    public EmployeeScheduleInfo(Integer id) {
        this.id = id;
    }

    public EmployeeScheduleInfo(Integer id, String date, String fromTo) {
        this.id = id;
        this.date = date;
        this.fromTo = fromTo;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getFromTo() {
        return fromTo;
    }

    public void setFromTo(String fromTo) {
        this.fromTo = fromTo;
    }

    public EmployeeSchedule getEmployeescheduleid() {
        return employeescheduleid;
    }

    public void setEmployeescheduleid(EmployeeSchedule employeescheduleid) {
        this.employeescheduleid = employeescheduleid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EmployeeScheduleInfo)) {
            return false;
        }
        EmployeeScheduleInfo other = (EmployeeScheduleInfo) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.company.management.EmployeeScheduleInfo[ id=" + id + " ]";
    }
    
}
